"""
https://docs.python.org/3/tutorial/modules.html#packages
"""
from python_baway.common.xcommon import sep
from python_baway.exercise.base import module
from python_baway.exercise.base.module import as_tutorial
from python_baway.exercise.base.module.as_tutorial.x6_modules_x6_1_more_on_modules import fibo
from python_baway.exercise.base.module.as_tutorial.x6_modules_x6_1_more_on_modules.fibo import fib
# from . import fibo as fibo2  # ImportError: attempted relative import with no known parent package

"""Contrarily, when using syntax like import item.subitem.subsubitem, each item except for the last must be a 
package; the last item can be a module or a package but can’t be a class or function or variable defined in the 
previous item. """
import python_baway.exercise.base.module.as_tutorial.x6_modules_x6_1_more_on_modules as package_x6_modules_x6_1_more_on_modules
import python_baway.exercise.base.module.as_tutorial.x6_modules_x6_1_more_on_modules.fibo as module_fibo

# ModuleNotFoundError: No module named 'python_baway.exercise.base.module.as_tutorial.x6_modules_x6_1_more_on_modules
# .fibo.fib'; 'python_baway.exercise.base.module.as_tutorial.x6_modules_x6_1_more_on_modules.fibo' is not a package
# import python_baway.exercise.base.module.as_tutorial.x6_modules_x6_1_more_on_modules.fibo.fib as func_fibo

sep('module.as_tutorial.x6_modules_x6_1_more_on_modules.fibo.fib(5)')
module.as_tutorial.x6_modules_x6_1_more_on_modules.fibo.fib(5)
sep('as_tutorial.x6_modules_x6_1_more_on_modules.fibo.fib(5)')
as_tutorial.x6_modules_x6_1_more_on_modules.fibo.fib(5)
sep('fibo.fib(5)')
fibo.fib(5)
sep('fib(5)')
fib(5)
# sep('fibo2.fib(5)')
# fibo2.fib(5)
sep('package_x6_modules_x6_1_more_on_modules.fibo.fib(5)')
package_x6_modules_x6_1_more_on_modules.fibo.fib(5)
sep('module_fibo.fib(5)')
module_fibo.fib(5)
